using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace KeyCore.Domain.Model
{
    public class DokumentTozsamosci
    {
        public Guid DokumentTozsamosciId { get; set; }
        public Nullable<Guid> DaneOsoboweId { get; set; }

        public string Seria { get; set; }
        public Int16 Numer { get; set; }
        public string OrganWydajacy { get; set; }
        public DateTime DataWydania { get; set; }
        public DateTime DataWaznosci { get; set; }
 
        public virtual TypDokumentu TypDokumentu { get; set; }

        public virtual DaneOsobowe DaneOsobowe { get; set; }
    }

    public class DokumentTozsamosciConfiguration : EntityTypeConfiguration<DokumentTozsamosci>
    {
        public DokumentTozsamosciConfiguration()
        {
            HasKey(k => k.DokumentTozsamosciId)
                .Property(p => p.DokumentTozsamosciId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
        }
    }
}